/**
 * @description  : 启动页
 * @descriptionDetail : 启动页
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-12-05 16:19:18
 */
<template>
  <view style="width: 100%;height: 100%;background-color: white;">
  </view>
</template>

<script>
export default {
  mounted() {
    this.init();
  },
  methods: {
    init() {
      // 钉钉环境根据请求的地址进行跳转
      // #ifdef H5-DINGDING || H5-WECHAT || H5-EMP
      let arr = this.queryDdRouterPath();
      if(arr[0] == ''){
        uni.reLaunch({
          url: "/pages/dashboard/dashboard",
        });
        return;
      }
      this.setRouteParam(arr[1]);
      uni.reLaunch({
        url: "/" + arr[0],
      });
      // #endif
      // #ifdef H5-ONLY
      let arr1 = this.queryDdRouterPath();
      this.setRouteParam(arr1[1]);
      uni.reLaunch({
        url: "/pages/dashboard/dashboard",
      });
      // #endif
    },
    queryDdRouterPath() {
      let param = {};
      let path = "";
      let search = window.location.search;
      if (search.indexOf("?") !== -1) {
        let queryString = search.substring(1);
        let qArr = queryString.split("&");
        qArr.forEach((r) => {
          let nv = r.split("=");
          if (nv[0] == 'path') {
            path = nv[1];
          } else {
            param[nv[0]] = nv[1];
          }
        });
      }
      return [path, param,];
    },
  },
}
</script>

<style scoped lang="scss">
	uni-page-body {
		height: 100%;
	}
</style>
